home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.3 KB | 124 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWArcShp.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWARCSHP_H
- #define FWARCSHP_H
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTDDEF_H
- #include <FWStdDef.h>
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CGraphicContext;
-
- //========================================================================================
- // class FW_CArcShape
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CArcShape : public FW_CBoundedShape
- {
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CArcShape(const FW_CRect& rect,
- short startAngle, short arcAngle,
- FW_ERenderVerbs renderVerb,
- const FW_PInk& ink = FW_kNormalInk,
- const FW_PStyle& style = FW_kNormalStyle);
-
- FW_CArcShape(const FW_CArcShape& other);
- FW_CArcShape(FW_CReadableStream& archive);
-
- virtual ~ FW_CArcShape();
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CArcShape& operator=(const FW_CArcShape& other);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Rendering -----
- virtual void Render(FW_CGraphicContext& gc) const;
-
- // ----- Hit Testing -----
- virtual FW_Boolean HitTest(FW_CGraphicContext& gc,
- const FW_CPoint& test,
- FW_CFixed tolerance) const;
-
- // ----- Copying -----
- virtual FW_CShape* Copy() const;
-
- // ----- Flatten -----
- virtual void Flatten(FW_CWritableStream& archive) const;
- static void* Read(FW_CReadableStream& archive);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Rendering -----
- static void RenderArc(FW_CGraphicContext& gc,
- const FW_CRect& rect,
- short startAngle, short arcAngle,
- FW_ERenderVerbs renderVerb,
- const FW_PInk& ink = FW_kNormalInk,
- const FW_PStyle& style = FW_kNormalStyle);
-
- // ----- Geometry -----
- void GetGeometry(FW_CRect& rect, short& startAngle, short& arcAngle) const;
- void SetGeometry(const FW_CRect& rect, short startAngle, short arcAngle);
-
- short GetStartAngle() const
- {return fStartAngle;}
- void SetStartAngle(short angle)
- {fStartAngle = angle;}
-
- short GetArcAngle() const
- {return fArcAngle;}
- void SetArcAngle(short angle)
- {fArcAngle = angle;}
-
- private:
- short CalcAngle(const FW_CPoint& test) const;
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- short fStartAngle;
- short fArcAngle;
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-